package kr.hkit.summury_java.erp.dto;

import java.text.DecimalFormat;

public class Employee {
	private int empNo;
	private String empName;
	private int title;
	private int manager;
	private int salary;
	private int deptNo;
	
	private String titleName;
	private String deptName;
	
	public void setTitleName(String titleName) {
		this.titleName = titleName;
	}
	
	public void setDeptName(String deptName) {
		this.deptName = deptName;
	}
	
	public Employee() {
	}
	
	public Employee(int empNo) { //검색,삭제 시 사용
		this.empNo = empNo;
		this.empName = "";
		this.title = 0;
		this.manager = 0;
		this.salary = 0;
		this.deptNo = 0;
	}

	public Employee(int empNo, String empName, int title, int manager,
			int salary, int deptNo) {
		this.empNo = empNo;
		this.empName = empName;
		this.title = title;
		this.manager = manager;
		this.salary = salary;
		this.deptNo = deptNo;
	}

	public int getEmpNo() {
		return empNo;
	}


	public void setEmpNo(int empNo) {
		this.empNo = empNo;
	}


	public String getEmpName() {
		return empName;
	}


	public void setEmpName(String empName) {
		this.empName = empName;
	}


	public int getTitle() {
		return title;
	}


	public void setTitle(int title) {
		this.title = title;
	}


	public int getManager() {
		return manager;
	}


	public void setManager(int manager) {
		this.manager = manager;
	}


	public int getSalary() {
		return salary;
	}


	public void setSalary(int salary) {
		this.salary = salary;
	}


	public int getDeptNo() {
		return deptNo;
	}


	public void setDeptNo(int deptNo) {
		this.deptNo = deptNo;
	}


	@Override
	public String toString() {
		return String
				.format("***** 사원 *****\n"
						+ "사원번호 = %s\n사원명 = %s\n직급 = %s\n"
						+ "직속상사 = %s\n급여 = %s원\n부서 = %s",
						empNo, empName, title, manager, salary, deptNo);
	}

	public String[] toArray() {
		DecimalFormat df = new DecimalFormat("#,###");
		return new String[] {String.valueOf(empNo), empName, 
							titleName, String.valueOf(manager),
							String.valueOf(df.format(salary)), deptName
		};
	}
	
	
}
